package com.blue.firecat.enums;

/**
 * @描述 用户类型
 * @时间 2017-6-22 10:04
 * @作者 肖亦鸣
 */
public enum UserTypeEnum {
    UNKNOWN(0, "未知"),
    ADMIN(1, "管理员"),
    CUSTOM_SERVICE(2, "客服"),
    BEATER(3, "打手");


    private int code;
    private String value;

    UserTypeEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValueByCode(int code) {
        for (UserTypeEnum type : UserTypeEnum.values()) {
            if (code == type.getCode()) {
                return type.getValue();
            }
        }
        return UNKNOWN.value;
    }


    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }


}

